home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Business Assistant
/
Business Assistant.iso
/
home
/
chkmstr
/
prtsum.prg
< prev
next >
Wrap
Text File
|
1990-03-05
|
11KB
|
429 lines
CLOSE DATABASE
STORE 0 TO LP,REXCF,ECB,ACCTNUM,VALU,BC,AC,CC,DC,EC,FC,GC,HC,REXCT,;
STATS2,REXCA,STATS,B03ST,REXDT,REXDF,ERROR,REXSEQ,REXDA,REXA,B11T,;
B13T,B14T,BT,CTP,ACTDB,ACTEB,ACTFB,ACTGB,ACTHB,ACB,BCB,CCB,DCB,;
CTB,GTB,ASUM,BSUM,DSUM,ESUM,FSUM,CSUM,ISUM,DPS,DEPSUM
RELEASE RETYEAR
PUBLIC RETYEAR
RETYEAR= " "
DONE= " "
IF ARCYEAR <> MYEAR
ARC= "1"
RTYV=ARCYEAR
MYEAR=ARCYEAR
DVCE=0
RETYEAR=STR(ARCYEAR,4)
ELSE
CLEAR
@10,27 SAY " ENTER { DATE } YOU WISH TO"
@11,27 SAY " PRINT ACCOUNT SUMMARY OF:"
@13,27 SAY "LEAVE MONTH BLANK FOR ENTIRE YEAR !"
@14,27 SAY " { MONTH }" GET DONE
@15,27 SAY " { YEAR }" GET RETYEAR
READ
DVCE=VAL("&DONE")
RTYV=VAL("&RETYEAR")
ENDIF
DO WHILE .T.
DO CASE
CASE MYEAR-RTYV=0
IF LP=0
CLEAR
@10,10 SAY "COMPUTING ACCOUNT CODE SUMMARIES FOR"
@11,10 SAY "CLEARED CHECKS FOR DATE { "+DONE+" "+RETYEAR+" } --------------"
USE CHKBKUP INDEX CBATNM
ELSE
CLEAR
@10,10 SAY "COMPUTING ACCOUNT CODE SUMMARIES FOR"
@11,10 SAY "UNCLEARED CHECKS FOR DATE { "+DONE+" "+RETYEAR+" } ------------"
USE CHEXREG INDEX CKATNM
ENDIF
CASE MYEAR-RTYV=1
IF LP=0
CLEAR
@10,10 SAY "COMPUTING ACCOUNT CODE SUMMARIES FOR"
@11,10 SAY "CLEARED CHECKS FOR DATE { "+DONE+" "+RETYEAR+" } --------------"
USE CHKBKUP INDEX CBATNM
ELSE
CLEAR
@10,10 SAY "COMPUTING ACCOUNT CODE SUMMARIES FROM"
@11,10 SAY "ARCHIVE REGISTER FOR DATE { "+DONE+" "+RETYEAR+" } -------------"
USE CHKARC INDEX CKARNM
ENDIF
CASE MYEAR-RTYV>1
CLEAR
@10,10 SAY "COMPUTING ACCOUNT CODE SUMMARIES FROM"
@11,10 SAY "ARCHIVE REGISTER FOR DATE { "+DONE+" "+RETYEAR+" } -------------"
USE CHKARC INDEX CKARNM
ENDCASE
DELETE FOR YEAR(DATE) <> RTYV
IF DVCE >0
DELETE FOR MONTH(DATE) <> DVCE
ENDIF
SUM AMOUNT FOR ACCT_CODE = 'A00' TO A00S
SUM AMOUNT FOR ACCT_CODE = 'A01' TO A01S
SUM AMOUNT FOR ACCT_CODE = 'A02' TO A02S
SUM AMOUNT FOR ACCT_CODE = 'A03' TO A03S
SUM AMOUNT FOR ACCT_CODE = 'A04' TO A04S
SUM AMOUNT FOR ACCT_CODE = 'A05' TO A05S
SUM AMOUNT FOR ACCT_CODE = 'A06' TO A06S
SUM AMOUNT FOR ACCT_CODE = 'A07' TO A07S
SUM AMOUNT FOR ACCT_CODE = 'A08' TO A08S
SUM AMOUNT FOR ACCT_CODE = 'A09' TO A09S
SUM AMOUNT FOR ACCT_CODE = 'A10' TO A10S
SUM AMOUNT FOR ACCT_CODE = 'A11' TO A11S
SUM AMOUNT FOR ACCT_CODE = 'A12' TO A12S
SUM AMOUNT FOR ACCT_CODE = 'B00' TO B00S
SUM AMOUNT FOR ACCT_CODE = 'B01' TO B01S
SUM AMOUNT FOR ACCT_CODE = 'B02' TO B02S
SUM AMOUNT FOR ACCT_CODE = 'B03' TO B03S
SUM AMOUNT FOR ACCT_CODE = 'B04' TO B04S
SUM AMOUNT FOR ACCT_CODE = 'B05' TO B05S
SUM AMOUNT FOR ACCT_CODE = 'B06' TO B06S
SUM AMOUNT FOR ACCT_CODE = 'B07' TO B07S
SUM AMOUNT FOR ACCT_CODE = 'B08' TO B08S
SUM AMOUNT FOR ACCT_CODE = 'B09' TO B09S
SUM AMOUNT FOR ACCT_CODE = 'B10' TO B10S
SUM AMOUNT FOR ACCT_CODE = 'B11' TO B11S
SUM AMOUNT FOR ACCT_CODE = 'B12' TO B12S
SUM AMOUNT FOR ACCT_CODE = 'B13' TO B13S
SUM AMOUNT FOR ACCT_CODE = 'B14' TO B14S
SUM AMOUNT FOR ACCT_CODE = 'D00' TO D00S
SUM AMOUNT FOR ACCT_CODE = 'D01' TO D01S
SUM AMOUNT FOR ACCT_CODE = 'D02' TO D02S
SUM AMOUNT FOR ACCT_CODE = 'E00' TO E00S
SUM AMOUNT FOR ACCT_CODE = 'E01' TO E01S
SUM AMOUNT FOR ACCT_CODE = 'E02' TO E02S
SUM AMOUNT FOR ACCT_CODE = 'F00' TO F00S
SUM AMOUNT FOR ACCT_CODE = 'F01' TO F01S
SUM AMOUNT FOR ACCT_CODE = 'F02' TO F02S
SUM AMOUNT FOR ACCT_CODE = 'A' TO ATS
SUM AMOUNT FOR ACCT_CODE = 'B' TO BTS
SUM AMOUNT FOR ACCT_CODE = 'C' TO CTS
SUM AMOUNT FOR ACCT_CODE = 'D' TO DTS
SUM AMOUNT FOR ACCT_CODE = 'E' TO ETS
SUM AMOUNT FOR ACCT_CODE = 'F' TO FTS
SUM AMOUNT FOR ACCT_CODE = 'G' TO GTS
SUM AMOUNT FOR ACCT_CODE = 'H' TO HTS
SUM AMOUNT FOR ACCT_CODE = 'I' TO ITS
PRT_TOT=ASUM+BSUM+CSUM+DSUM+ESUM+FSUM+CTB+GTB+ISUM
DO CASE
CASE MYEAR-RTYV<=1
IF LP=0
LP=1
SET DELETED OFF
RECALL ALL
SET DELETED ON
LOOP
ENDIF
SET DELETED OFF
RECALL ALL
SET DELETED ON
EXIT
CASE MYEAR-RTYV>1
SET DELETED OFF
RECALL ALL
SET DELETED ON
EXIT
ENDCASE
ENDDO
LP=0
DO WHILE .T.
DO CASE
CASE MYEAR-RTYV=0
IF LP=0
CLEAR
@10,10 SAY "COMPUTING DEPOSIT TOTAL FOR CLEARED DEPOSITS"
@11,10 SAY "FOR YEAR { "+DONE +RETYEAR+" } --------------------------"
USE DEPBKUP INDEX DBKAMT
ELSE
CLEAR
@10,10 SAY " COMPUTING DEPOSIT TOTAL FOR UNCLEARED DEPOSITS"
@11,10 SAY "FOR YEAR { "+DONE+" "+RETYEAR+" } -------------------------"
USE DEPREG INDEX DEPAMT
ENDIF
CASE MYEAR-RTYV=1
IF LP=0
CLEAR
@10,10 SAY "COMPUTING DEPOSIT TOTAL FOR CLEARED DEPOSITS"
@11,10 SAY "FOR YEAR { "+DONE+" "+RETYEAR+" } -------------------------"
USE DEPBKUP INDEX DBKAMT
ELSE
CLEAR
@10,10 SAY "COMPUTING DEPOSIT TOTAL FOR ARCHIVE DEPOSITS"
@11,10 SAY "FOR YEAR { "+DONE+" "+RETYEAR+" } ------------------------"
USE DEPARC INDEX DARAMT
ENDIF
CASE MYEAR-RTYV>1
CLEAR
@10,10 SAY "COMPUTING DEPOSIT TOTAL FOR ARCHIVE DEPOSITS"
@11,10 SAY "FOR YEAR { "+DONE+" "+RETYEAR+" } -----------------------"
USE DEPARC INDEX DARAMT
ENDCASE
DELETE FOR YEAR(DATE) <> RTYV
IF DVCE >0
DELETE FOR MONTH(DATE) <> DVCE
ENDIF
SUM AMOUNT TO DPS
DEPSUM = DEPSUM+DPS
DO CASE
CASE MYEAR-RTYV<=1
IF LP=0
LP=1
SET DELETED OFF
RECALL ALL
SET DELETED ON
LOOP
ENDIF
SET DELETED OFF
RECALL ALL
SET DELETED ON
EXIT
CASE MYEAR-RTYV>1
SET DELETED OFF
RECALL ALL
SET DELETED ON
EXIT
ENDCASE
ENDDO
CLEAR
@10,10 SAY "PRINTING ACCOUNT SUMMARIES FOR DATE { "+DONE+" "+RETYEAR+" }."
SET DEVICE TO PRINT
@1,10 SAY "SUMMARY OF CHECK TOTALS BY ACCOUNT CODE"
@2,10 SAY " FOR DATE { "+DONE+" "+RETYEAR+" }"
@3,10 SAY "RUN " + DTOC(MDATE)
@3,30 SAY "TODAY IS " + CDOW(MDATE)
@5,10 SAY " TOTAL OF DEPOSITS $$ " +STR(DEPSUM,8,2)
@6,10 SAY "TOTAL OF CHECKS WRITTEN $$ " +STR(PRT_TOT,8,2)
@8,10 SAY "MISC. ACCOUNT { A } $$ " + STR(REXCF,7,2)
@9,10 SAY A01 + " $$ " + STR(ECB,7,2)
@10,10 SAY A02 + " $$ " + STR(ACCTNUM,7,2)
@11,10 SAY A03 + " $$ " + STR(VALU,7,2)
@12,10 SAY A04 + " $$ " + STR(BC,7,2)
@13,10 SAY A05 + " $$ " + STR(AC,7,2)
@14,10 SAY A06 + " $$ " + STR(CC,7,2)
@15,10 SAY A07 + " $$ " + STR(DC,7,2)
@16,10 SAY A08 + " $$ " + STR(EC,7,2)
@17,10 SAY A09 + " $$ " + STR(FC,7,2)
@18,10 SAY A10 + " $$ " + STR(GC,7,2)
@19,10 SAY A11 + " $$ " + STR(HC,7,2)
@20,10 SAY A12 + " $$ " + STR(REXCT,7,2)
@22,10 SAY "MISC. ACCOUNT { B } $$ " + STR(STATS2,7,2)
@23,10 SAY B01 + " $$ " + STR(REXCA,7,2)
@24,10 SAY B02 + " $$ " + STR(STATS,7,2)
@25,10 SAY B03 + " $$ " + STR(B03ST,7,2)
@26,10 SAY B04 + " $$ " + STR(REXDT,7,2)
@27,10 SAY B05 + " $$ " + STR(REXDF,7,2)
@28,10 SAY B06 + " $$ " + STR(ERROR,7,2)
@29,10 SAY B07 + " $$ " + STR(REXSEQ,7,2)
@30,10 SAY B08 + " $$ " + STR(REXDA,7,2)
@31,10 SAY B09 + " $$ " + STR(REXA,7,2)
@32,10 SAY B10 + " $$ " + STR(B11T,7,2)
@33,10 SAY B11 + " $$ " + STR(BT,7,2)
@34,10 SAY B12 + " $$ " + STR(CTP,7,2)
@35,10 SAY B13 + " $$ " + STR(B13T,7,2)
@36,10 SAY B14 + " $$ " + STR(B14T,7,2)
@38,10 SAY "MISC. ACCOUNT { D } $$ " + STR(ACTDB,7,2)
@39,10 SAY D01 + " $$ " + STR(ACTEB,7,2)
@40,10 SAY D02 + " $$ " + STR(ACTFB,7,2)
@42,10 SAY "MISC. ACCOUNT { E } $$ " + STR(ACTGB,7,2)
@43,10 SAY E01 + " $$ " + STR(ACTHB,7,2)
@44,10 SAY E02 + " $$ " + STR(ACB,7,2)
@46,10 SAY "MISC. ACCOUNT { F } $$ " + STR(BCB,7,2)
@47,10 SAY F01 + " $$ " + STR(CCB,7,2)
@48,10 SAY F02 + " $$ " + STR(DCB,7,2)
@50,10 SAY A + " $$ " + STR(ASUM,7,2)
@51,10 SAY B + " $$ " + STR(BSUM,7,2)
@52,10 SAY C + " $$ " + STR(CSUM,7,2)
@53,10 SAY D + " $$ " + STR(DSUM,7,2)
@54,10 SAY E + " $$ " + STR(ESUM,7,2)
@55,10 SAY F + " $$ " + STR(FSUM,7,2)
@56,10 SAY G + " $$ " + STR(CTB,7,2)
@57,10 SAY H + " $$ " + STR(GTB,7,2)
@58,10 SAY I + " $$ " + STR(ISUM,7,2)
EJECT
SET DEVICE TO SCREEN
IF ARC= "1"
PRTC= "1"
DO CSUMRY
CRUN=CRUN+CNTOT
CLEAR
@10,23 SAY "NOW TRANSFERRING CHECK AND DEPOSIT"
@12,23 SAY " REGISTERS TO BACK-UP FILE !!"
SELECT A
USE CHKBKUP INDEX CBATNM,CHBKPT,CKBKSQ
SELECT B
USE CHKARC INDEX CKARNM,CHARPT,CKARSQ
SELECT C
USE DEPBKUP INDEX DBKAMT
SELECT D
USE DEPARC INDEX DARAMT
SELECT CHKBKUP
GO TOP
DO WHILE .NOT.EOF()
REXSEQ=SEQ_NO
PAYM=PAY_TO
REXA=AMOUNT
REXD=DATE
NOTEM=NOTE
ACCTM=ACCT_CODE
CKARC=CKARC+AMOUNT
SELECT CHKARC
APPE